﻿using System;
using System.Collections.Generic;

namespace TSharp.Core.Authentication.Facade
{
    /// <summary>
    /// 
    /// <para>2010/7/7</para>
    /// 	<para>THINKPADT61</para>
    /// 	<para>tangjingbo</para>
    /// </summary>
    public interface IUser : IEqualityComparer<IUser>
    {
        /// <summary>
        /// Gets the name of the user.
        /// </summary>
        /// <value>The name of the user.</value>
        String UserName { get; }

        /// <summary>
        /// Gets or sets the email.
        /// </summary>
        /// <value>The email.</value>
        string Email { get; set; }

        /// <summary>
        /// Gets the password question.
        /// </summary>
        /// <value>The password question.</value>
        string PasswordQuestion { get; }

        /// <summary>
        /// Gets or sets the comment.
        /// </summary>
        /// <value>The comment.</value>
        string Comment { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is approved.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is approved; otherwise, <c>false</c>.
        /// </value>
        bool IsApproved { get; set; }

        /// <summary>
        /// Gets a value indicating whether this instance is locked out.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is locked out; otherwise, <c>false</c>.
        /// </value>
        bool IsLockedOut { get; }

        /// <summary>
        /// Gets the last lockout date.
        /// </summary>
        /// <value>The last lockout date.</value>
        DateTime LastLockoutDate { get; }

        /// <summary>
        /// Gets the creation date.
        /// </summary>
        /// <value>The creation date.</value>
        DateTime CreationDate { get; }

        /// <summary>
        /// Gets or sets the last login date.
        /// </summary>
        /// <value>The last login date.</value>
        DateTime LastLoginDate { get; set; }

        /// <summary>
        /// Gets or sets the last activity date.
        /// </summary>
        /// <value>The last activity date.</value>
        DateTime LastActivityDate { get; set; }

        /// <summary>
        /// Gets the last password changed date.
        /// </summary>
        /// <value>The last password changed date.</value>
        DateTime LastPasswordChangedDate { get; }

        /// <summary>
        /// Gets a value indicating whether this instance is online.
        /// </summary>
        /// <value><c>true</c> if this instance is online; otherwise, <c>false</c>.</value>
        bool IsOnline { get; }

        /// <summary>
        /// Gets the name of the provider.
        /// </summary>
        /// <value>The name of the provider.</value>
        string ProviderName { get; }

        /// <summary>
        /// Gets or sets the extend.
        /// </summary>
        /// <value>The extend.</value>
        Object Extend { get; set; }

        /// <summary>
        /// Gets the password.
        /// </summary>
        /// <returns></returns>
        string GetPassword();

        /// <summary>
        /// Gets the password.
        /// </summary>
        /// <param name="passwordAnswer">The password answer.</param>
        /// <returns></returns>
        string GetPassword(string passwordAnswer);

        /// <summary>
        /// Changes the password.
        /// </summary>
        /// <param name="oldPassword">The old password.</param>
        /// <param name="newPassword">The new password.</param>
        /// <returns></returns>
        bool ChangePassword(string oldPassword, string newPassword);

        /// <summary>
        /// Changes the password question and answer.
        /// </summary>
        /// <param name="password">The password.</param>
        /// <param name="newPasswordQuestion">The new password question.</param>
        /// <param name="newPasswordAnswer">The new password answer.</param>
        /// <returns></returns>
        bool ChangePasswordQuestionAndAnswer(string password, string newPasswordQuestion, string newPasswordAnswer);

        /// <summary>
        /// Resets the password.
        /// </summary>
        /// <param name="passwordAnswer">The password answer.</param>
        /// <returns></returns>
        string ResetPassword(string passwordAnswer);

        /// <summary>
        /// Resets the password.
        /// </summary>
        /// <returns>password</returns>
        string ResetPassword();

        /// <summary>
        /// Unlocks the user.
        /// </summary>
        /// <returns></returns>
        bool UnlockUser();
    }
}